package com.dream.myqiyi.search;

import java.text.BreakIterator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.dream.myqiyi.R;
import com.dream.myqiyi.account.ZiyuanmingxiActivity;
import com.cloud.httputil.*;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.GridView;
import android.widget.RelativeLayout;
import android.widget.TextView;


public class SearchActivity extends Activity {
	GridView mHotGridView, mHistoryGridView;
	TextView mTitleView;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.zjgs);
		prepareView();
		mTitleView.setText(R.string.category_more);
		
		RelativeLayout mRelativeLayout1 = (RelativeLayout)findViewById(R.id.gd);
		RelativeLayout mRelativeLayout2 = (RelativeLayout)findViewById(R.id.xj);
		RelativeLayout mRelativeLayout3 = (RelativeLayout)findViewById(R.id.wz);
		RelativeLayout mRelativeLayout4 = (RelativeLayout)findViewById(R.id.ny);
		RelativeLayout mRelativeLayout5 = (RelativeLayout)findViewById(R.id.dw);
		RelativeLayout mRelativeLayout6 = (RelativeLayout)findViewById(R.id.tz);
		
		mRelativeLayout1.setOnClickListener(listener);
		mRelativeLayout2.setOnClickListener(listener);
		mRelativeLayout3.setOnClickListener(listener);
		mRelativeLayout4.setOnClickListener(listener);
		mRelativeLayout5.setOnClickListener(listener);
		mRelativeLayout6.setOnClickListener(listener);


		
		
	}
	/***
	 * 所有模块的点击监听
	 * **/
	OnClickListener listener=new OnClickListener() {
		
		@Override
		public void onClick(View v) {
			switch (v.getId()) {
			case R.id.gd:
				//固定资产
				Intent gdintent = new Intent();
				gdintent.setClass(SearchActivity.this, GudingzichanActivity.class);
				startActivity(gdintent);
				break;
			case R.id.xj:
				//现金
				Intent xjintent = new Intent();
				xjintent.setClass(SearchActivity.this, XianjinActivity.class);
				startActivity(xjintent);
				break;
				
			case R.id.wz:
				//物质
				Intent wzintent = new Intent();
				//wzintent.setClass(SearchActivity.this, ChanpinwuziActivity.class);
				wzintent.setClass(SearchActivity.this, XianjinActivity.class);
				wzintent.putExtra("listType", "5");
				startActivity(wzintent);
			    break;
			case R.id.ny:
				//农业
				Intent nyintent = new Intent();
				//nyintent.setClass(SearchActivity.this, NyzichanActivity.class);
				nyintent.setClass(SearchActivity.this, XianjinActivity.class);
				nyintent.putExtra("listType", "7");
				startActivity(nyintent);
				break;
			case R.id.dw:
				//对外
				Intent dwintent = new Intent();
				//dwintent.setClass(SearchActivity.this, DuiwaitouziActivity.class);
				dwintent.setClass(SearchActivity.this, XianjinActivity.class);
				dwintent.putExtra("listType", "8");
				startActivity(dwintent);
				break;
			case R.id.tz:
				//其他投资
				Intent tzintent = new Intent();
				//tzintent.setClass(SearchActivity.this, QitazichanActivity.class);
				tzintent.setClass(SearchActivity.this, XianjinActivity.class);
				tzintent.putExtra("listType", "9");
				startActivity(tzintent);
				break;
				

			default:
				break;
			}
			
		}
	};
	

	private void prepareView() {
//		mHotGridView = (GridView) findViewById(R.id.hot_search_grid);
//		mHotGridView.setAdapter(new GridAdapter(this));
//		mHistoryGridView = (GridView) findViewById(R.id.history_search_grid);
//		mHistoryGridView.setAdapter(new GridAdapter(this));
		mTitleView = (TextView) findViewById(R.id.title_text);
	}
}
